import axios from "axios"
export default {
    namespaced: true,
    state: {
        list: [],
        findlist1: {}
    },
    getters: {
        finding: function (state, playload) {
            let { type, value } = state.findlist1
            let newarr = state.list
            // 判断搜索条件是否输入
            if (value) {
                return newarr.filter(item => item[type].includes(value))
            }
            return state.list

        }
    },
    mutations: {

        list: function (state, payload) {
            state.list = payload
        },
        // 将查询条件放入厂库
        finders: function (state, playload) {
            state.findlist1 = playload
        },

    },
    actions: {
        // 渲染列表
        getuser: function (context,payload) {
            axios.get("/api/putin",{params:{state:payload}}).then(res => {
                context.state.list = res.data
            })
        },
        //通过
        verify: function (context, payload) {
            console.log(payload);
            axios.post("/api/putin/passone", payload).then(res => {
               
            })
        },

       
    
        
    }





}